# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-build-utils
pkgname=('python2-build-utils' 'python-build-utils')
_pkgname=build_utils
pkgver=0.0.1
pkgrel=5
pkgdesc='Some tools to help build python2 and python3 libraries.'
arch=('any')
url='https://pypi.org/project/build-utils/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python2-colorama' 'python-setuptools'
             'python-colorama' 'wget')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('e01eb2e2b57362a67ded4d482d3ce895da13741cc9a8dc47607fb4f78bc7903edc893e70efdb92f4abb32d3d1abc15cebf9b7470b2db7e73a4a62054069c6e11')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}

  cd "$_pkgname-$pkgver-2"

  wget -q https://raw.githubusercontent.com/walchko/build_utils/master/readme.md

  cp readme.md "$srcdir/$_pkgname-$pkgver/"
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-build-utils() {
  depends=('python2' 'python2-colorama')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-build-utils() {
  depends=('python' 'python-colorama')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

